const http = {
  get(url) {
    return fetch(url)
      .then((response) => response.json())
      .then((res) => {
        // this.cityList = res.result.slice(1);
        // commit("changeCityList", res);
        // commit("changehotCity", res);
        return res;

        // this.hotCity = res.result.slice(0, 1)[0].cities;
      });
  },
  post(url, payload) {
    return fetch(url, {
      method: "POST",
      body: JSON.stringify(payload),
      headers: {
        "content-type": "application/json",
      },
    })
      .then((response) => response.json())
      .then((res) => {
        // commit("detailData", res);
        // this.detailInfo = res.result;
        return res;
      });
  },
};
export default http;
